﻿@using Peresvet.Common.Constants
@model IEnumerable<Peresvet.Models.GalleryItemModel>
@{
	ViewBag.Title = "Галерея";
}

@if (Model != null && Model.Any())
{
	<div>
		@for (var index = 0; index < Model.Count(); index++)
		{
			<div class="gallery">
				<a href="@(Url.Action<HomeController>(m => m.Gallery(Model.ElementAt(index).GalleryId)))">
					<img src="../../@(!string.IsNullOrWhiteSpace(Model.ElementAt(index).ThumbImageUrl)
						                  ? Model.ElementAt(index).ThumbImageUrl
						                  : ApplicationSettings.DEFAULT_GALLERY_THUMB_IMAGE_URL)" />
				</a>
				<h3>@(Model.ElementAt(index).ShortName ?? string.Empty)</h3>
			</div>
		}
	</div>
}
